/*uOZA38oi3OD2YxINQKOJK4h1UQular5PQqISdrmcKwYZBG9SrNE3M6QKTz0yVPYd*/
/*
 * @Descripttion:
 * @version:
 * @Author: Chendch
 * @Date: 2020-10-14 17:18:33
 * @LastEditors: Chendch
 * @LastEditTime: 2020-11-24 13:34:43
 */
import { ajax, toast } from 'nc-lightapp-front';
import {Urls} from "../CONSTANCE";
function freezeSupplier(data) {
    return new Promise( (resolve, reject) => {
        ajax({
            url: Urls.freezeSupplierUrl,
            data,
            success : (res) => {
                const {success, data} = res;
                if(!success) {
                    resolve({})
                }
                resolve(data);
            },
            error: (msg) => {
                toast({content:msg.message,color:'danger'});
                reject("error");
            }
        })
    })
}

function quickBatchUpdate(param) {
    return new Promise( (resolve, reject) => {
        ajax({
            url:Urls.quickBatchUpdateUrl,
            data:param,
            success:(res)=>{
                resolve(res);
            },
            error: (res) => {
                console.log(res.message);
                resolve("error");
            }
        })
    })

}

export {
    freezeSupplier,
    quickBatchUpdate
}

/*uOZA38oi3OD2YxINQKOJK4h1UQular5PQqISdrmcKwYZBG9SrNE3M6QKTz0yVPYd*/
